package dto

import (
	"github.com/gin-gonic/gin"
	"k8s-dash/utils"
)

type StsUpdateInput struct {
	Content   string `json:"content" form:"content" comment:"内容" validate:"required"`
	Namespace string `json:"namespace" form:"namespace" validate:"required" comment:"命名空间"`
}

type StsScaleInput struct {
	Name      string `json:"deploy_name" form:"deploy_name" comment:"deploy名称" validate:"required"`
	Namespace string `json:"namespace" form:"namespace" validate:"required" comment:"命名空间"`
	ScaleNum  int    `json:"scale_num" form:"scale_num" comment:"期望副本数" validate:"required"`
}
type StsNameInput struct {
	Name      string `json:"name" form:"name" comment:"名字" validate:"required"`
	Namespace string `json:"namespace" form:"namespace" validate:"required" comment:"命名空间"`
}
type StsListInput struct {
	FilterName string `json:"filter_name" form:"filter_name" validate:"" comment:"过滤名"`
	Namespace  string `json:"namespace" form:"namespace" validate:"" comment:"命名空间"`
	Limit      int    `json:"limit" form:"limit" validate:"" comment:"分页限制"`
	Page       int    `json:"page" form:"page" validate:"" comment:"页码"`
}

func (p *StsListInput) BindValidate(c *gin.Context) error {
	return utils.DefaultParamsValidate(c, p)
}

func (p *StsUpdateInput) BindValidate(c *gin.Context) error {
	return utils.DefaultParamsValidate(c, p)
}

func (p *StsNameInput) BindValidate(c *gin.Context) error {
	return utils.DefaultParamsValidate(c, p)
}
func (p *StsScaleInput) BindValidate(c *gin.Context) error {
	return utils.DefaultParamsValidate(c, p)
}
